package com.jml.SessionAttribute;

import com.jml.注册校验器.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

@Controller
@RequestMapping("/redirect")
public class RedirectParamController {

    @RequestMapping(value = {"/signup"},method = {RequestMethod.GET})
    public String signup(@Validated User user, BindingResult br, RedirectAttributes ra){
        ra.addFlashAttribute("user",user);
        return "redircet:show";
    }

    @RequestMapping(value = {"/show"},method = {RequestMethod.GET})
    public String show(@Validated User user, BindingResult br){
        return "go.jsp";
    }
}
